package com.ltmonitor.jt808.protocol;

public class PostitionAdditional_InOutAreaAlarmAdditional implements
		IPositionAdditionalItem {

	public final int getAdditionalId() {
		return 0x12;
	}

	public final byte getAdditionalLength() {
		return 0x06;
	}

	/**
	 * 位置类型
	 */
	private byte positionType;

	public final byte getPositionType() {
		return positionType;
	}

	public final void setPositionType(byte value) {
		positionType = value;
	}

	/**
	 * 区域或路段ID
	 */

	private int areaId;

	public final int getAreaId() {
		return areaId;
	}

	public final void setAreaId(int value) {
		areaId = value;
	}

	/**
	 * 方向,0:进,1:出
	 */
	private byte direction;

	public final byte getDirection() {
		return direction;
	}

	public final void setDirection(byte value) {
		direction = value;
	}

	public final byte[] WriteToBytes() {
		try {
			MyBuffer buff = new MyBuffer();
			try {
				buff.put(getPositionType());
				buff.put(getAreaId());
				buff.put(getDirection());
			} finally {

			}
			return buff.array();
		} finally {

		}
	}

	public final void ReadFromBytes(byte[] bytes) {

		try {
			MyBuffer buff = new MyBuffer(bytes);
			try {
				setPositionType(buff.get());
				setAreaId(buff.getInt());
				setDirection(buff.get());
			} finally {

			}
		} finally {

		}
	}
}